//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include "ccondition.h"

PInterface CCondition::Probe(
    /* [in ] */ REIID riid)
{
    if (riid == EIID_IInterface) {
        return (PInterface)(ICondition *)this;
    }
    else if (riid == EIID_ICondition) {
        return (ICondition *)this;
    }
    else if (riid == EIID_CLASS_INFO) {
        return (PInterface)&ECLSID_CCondition;
    }
    else if (riid == EIID_INTERFACE_INFO) {
        return (PInterface)&EIID_ICondition;
    }

    return NULL;
}

UInt32 CCondition::AddRef()
{
    Int32 nRef = m_cRef.Increment();
    return (UInt32)nRef;
}

UInt32 CCondition::Release()
{
    Int32 nRef = m_cRef.Decrement();
    if (0 >= nRef) {
        delete this;
    }
    return (UInt32)nRef;
}

ECode CCondition::Aggregate(
    /* [in ] */ AggregateType type,
    /* [out] */ PInterface pObject)
{
    // todo;
    return E_NOT_IMPLEMENTED;
}

ECode CCondition::GetDomain(
    /* [out] */ PInterface * ppObject)
{
    // todo;
    return E_NOT_IMPLEMENTED;
}

ECode CCondition::Wait(
    /* [in] */ IMutex *pMutex,
    /* [out] */ WaitResult *pResult)
{
    // todo;
    return E_NOT_IMPLEMENTED;
}

ECode CCondition::TryWait(
    /* [in] */ IMutex *pMutex,
    /* [in] */ Millisecond32 msTimeout,
    /* [out] */ WaitResult *pResult)
{
    // todo;
    return E_NOT_IMPLEMENTED;
}

ECode CCondition::Pulse()
{
    // todo;
    return E_NOT_IMPLEMENTED;
}

ECode CCondition::PulseAll()
{
    // todo;
    return E_NOT_IMPLEMENTED;
}

